﻿using sharpxbot.Core.Configuration;
using sharpxbot.Core.Connection;
using sharpxbot.Core.Messaging;
using sharpxbot.Core.Muc;
using sharpxbot.Core.Threading;

namespace sharpxbot.Plugins.Context
{
    public class PluginContext : IPluginContext
    {
        public PluginContext(IConfiguration configuration, IConnection connection)
        {
            GroupChats = new GroupChatContext(connection, configuration);
            ActiveHelper.StartIfActive(GroupChats);

            Channel = new XmppChannel(connection);
            ActiveHelper.StartIfActive(Channel);

            PluginDataPath = configuration.PluginsDataPath;
            OwnerJid = configuration.OwnerJid;
        }

        #region IPluginContext Members

        public IGroupChatContext GroupChats { get; private set; }

        public IChannel Channel { get; private set; }

        public string PluginDataPath { get; private set; }

        public string OwnerJid { get; private set; }

        #endregion
    }
}
